package com.zpself.module.spring.AOP.Proxy实现.我的实现;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.util.Random;

/**
 * @author By ZengPeng
 * @Description
 * @date in  2021/3/24 21:37
 * @Modified By
 */
public class InvocationHandlerImpl implements InvocationHandler {
    //被代理的对象
    public Object targetObject;
    public InvocationHandlerImpl( Object targetObject){
        this.targetObject = targetObject;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("进入了文明时代的人类，吃饭先洗手!");
        return method.invoke(targetObject, args);
    }
}
